package sanshi.contect.observer.v4;

/**
 * 多个观察者：：
 *  被观察者可以被多个观察者进行观察
 *  不够灵活。
 */
public class Main {
    public static void main(String[] args) {
        new Child().wakeUp();
    }
}
class Dog{
    public void wang(){
        System.out.println("dog wang wang wang ....");
    }
}

class Mum{
    public void hug(){
        System.out.println("Mun   ....");
    }
}

class Dad{
    public void feed(){
        System.out.println("Dad ....");
    }
}
class Child {

    Dad dad = new Dad();
    Mum mum = new Mum();
    Dog dog = new Dog();

    public boolean cry = false;

    public boolean isCry(){
        return cry;
    }

    public void wakeUp(){
        cry = true;
        dad.feed();
        mum.hug();
        dog.wang();
    }

}